<!DOCTYPE >
<html lang="zh-cn">

	<head>
		<title>后台管理-功能</title>
		<% include ../partials/head %>

			<script type="text/javascript">
				var oMistake = {
					operator: function() {
						$(".pass").on('click', function() {
							$this = $(this)
							if (window.confirm('你确定忽略该用户么？')) {
								$.post("/admin/mistake/pass", {
									"notifyId": $this.attr('notifyId'),
								}, function(json) {
									if (json.code == 0) {
										$this.parents('tr').remove();
									} else {
										alert(json.msg);
									}
								}, 'json');
							} else {
								//取消
							}
						})
						$(".notify").on('click', function() {
								$this = $(this)
								content = $this.prev().val().trim();
								if (window.confirm('你确定警告并回复该用户么？')) {
									$.post("/admin/mistake/alert", {
										"notifyId": $this.attr('notifyId'),
										"content": content,
									}, function(json) {
										if (json.code == 0) {
											$this.parents('tr').remove();
										} else {
											alert(json.msg);
										}
									}, 'json');
								} else {
									//取消
								}
							})
							//封号
						$(".closure").on('click', function() {
								$this = $(this)
								if (window.confirm('你确定封禁该用户么？')) {
									$.post("/admin/mistake/close", {
										"notifyId": $this.attr('notifyId'),
									}, function(json) {
										if (json.code == 0) {
											$this.parents('tr').remove();
										} else {
											alert(json.msg);
										}
									}, 'json');
								} else {
									//取消
								}
							})
							//恢复身份
						$(".resume").on('click', function() {
							$this = $(this)
							if (window.confirm('你确定恢复该用户的身份么？')) {
								$.post("/admin/mistake/resume", {
									"notifyId": $this.attr('notifyId'),
								}, function(json) {
									if (json.code == 0) {
										$this.parents('tr').remove();
									} else {
										alert(json.msg);
									}
								}, 'json');
							} else {
								//取消
							}
						})
					},
					init: function() {
						this.operator();
					}
				}
				$(document).ready(function() {
					oMistake.init();
				})
			</script>
	</head>

	<body>
		<header>
			<!-- Preloader -->
			<div id="preloader">
				<div id="status">&nbsp;</div>
			</div>
		</header>
		<div class="ch-container">

			<!-- 首页内容 -->
			<div class="wrap-fluid">
				<div class="container-fluid paper-wrap bevel tlbr">

					<!-- CONTENT -->
					<!--TITLE -->

					<!--/ TITLE -->

					<!-- BREADCRUMB -->
					<ul id="breadcrumb">
						<li>
							<span class="entypo-home"></span>
						</li>
						<li><i class="fa fa-lg fa-angle-right"></i>
						</li>
						<li><a href="#" title="复审管理">复审管理</a>
						</li>
					</ul>

					<!--测试数据-->
					<div class="content-wrap">
						<div class="row">
							<div class="col-sm-12">
								<div class="nest" id="FootableClose">
									<div class="title-alt">
										<h6>复审管理</h6>
										<div class="titleClose">
											<a class="gone" href="#FootableClose">
												<span class="entypo-cancel"></span>
											</a>
										</div>
										<div class="titleToggle">
											<a class="nav-toggle-alt" href="#Footable">
												<span class="entypo-up-open"></span>
											</a>
										</div>

									</div>
									<div class="body-nest" id="Filtering">

										<div class="row" style="margin-bottom:10px;">
											<div class="col-sm-4">
												<input class="form-control" id="filter" placeholder="Search..." type="text">
											</div>
											<div class="col-sm-2">
												<select id="report-filter" class="filter-status form-control">
													<option>全部</option>
													<option value="0">未处理</option>
													<option value="2">已忽略</option>
													<option value="1">已处理</option>
												</select>
											</div>
											<!--<div class="col-sm-2">
													<select class="filter-num form-control">
														<option value="1">每页10个
															<option value="2">每页50个
																<option value="3">每页100个
													</select>
												</div>-->
											<div class="col-sm-6">

												<a href="#clear" style="margin-left:10px;" class="pull-right btn btn-info clear-filter" title="clear filter">重置</a>
											</div>

										</div>
										<table class="table-striped footable-res footable metro-blue data-table" data-page-size="30" data-filter="#filter" data-filter-text-only="true">
											<thead>
												<tr>
													<th></th>
													<th>用户</th>
													<th>用户ID</th>
													<th data-sort-initial="ascending">修改时间</th>
													<th>处理操作</th>
												</tr>
											</thead>

											<tbody>
												<% if (typeof notifys != "undefined") { %>
													<% notifys.forEach(function(notify,index) { %>
														<tr>
															<td class="center">
																<%=index%>
															</td>
															<td>
																<a href="/admin/userinfo?userId=<%= notify.get('user').id%>">
																	<%= notify.get("user")? notify.get("user").get("nickname"):"" %>
																</a>
															</td>
															<td class="center">
																<%= notify.get("user").get("molianId") %>
															</td>
															<td class="center">
																<%= Format(notify.createdAt) %>
															</td>
															<td class="center">
																<input class="reply" type="text">
																<span class="btn btn-danger notify" notifyId=<%=notify.id%>>
                                  <i class="glyphicon glyphicon-remove icon-white"></i>
                                   警告并回复
                                </span>
																<span class="btn btn-success pass" notifyId=<%=notify.id%>>
                                  <i class="glyphicon glyphicon-ok icon-white"></i>
                                   忽略 
                                </span>
																<span class="btn btn-danger closure" notifyId=<%=notify.id%>>
                                  <i class="glyphicon glyphicon-remove icon-white"></i>
                                   封号
                                </span>
																<span class="btn btn-info resume" notifyId=<%=notify.id%>>
                                  <i class="glyphicon glyphicon-ok icon-white"></i>
                                   恢复正常状态
                                </span>
															</td>
														</tr>
														<% }) %>
															<% } %>
											</tbody>

											<tfoot>
												<tr>
													<td colspan="5">
														<div class="pagination pagination-centered"></div>
													</td>
												</tr>
											</tfoot>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- END OF BREADCRUMB -->

					<!-- /END OF CONTENT -->

					<!-- FOOTER -->
					<div class="footer-space"></div>
					<div id="footer">
						<div class="devider-footer-left"></div>
						<div class="time">
							<p id="spanDate">
								<p id="clock">
						</div>
						<div class="copyright">Made by HT
							<span class="entypo-heart"></span>广州聚脉互联网络服务有限公司</div>
						<div class="devider-footer"></div>

					</div>
					<!-- / END OF FOOTER -->

				</div>
			</div>

		</div>
		<% include ../partials/external %>

			<script src="/assets/js/button/ladda/spin.min.js"></script>

			<script src="/assets/js/button/ladda/ladda.min.js"></script>

			<script src="/assets/js/footable/js/footable.filter.js"></script>

			<script type="text/javascript">
				$(function() {
					$('.footable-res').footable();
				});
			</script>
	</body>
</html>